package com.interest.business.task;

import com.interest.business.mapper.InterestRedeemCodeMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 将已发放、已售但未领取、已过期优惠券券码回归券码池
 */
@Component
public class ReleaseNotReceiveCouponTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(ReleaseNotReceiveCouponTask.class);

    @Autowired
    InterestRedeemCodeMapper interestRedeemCodeMapper;


    public void releaseCouponToPool(){
        LOGGER.info("将已发放、已售但未领取、已过期优惠券券码回归券码池任务开始...");
        interestRedeemCodeMapper.releaseCouponToPool();
        LOGGER.info("将已发放、已售但未领取、已过期优惠券券码回归券码池任务结束...");

        //查询这个表interest_redeem_code里被回滚过的订单，然后重新构建记录一个新的表，然后供前端展示
    }
}
